package com.oa.util;

import javax.servlet.http.HttpServletRequest;

public class Page {
	public static int getPage(HttpServletRequest request) {
		int page = 1;
		String pageStr = request.getParameter("page");
		if (pageStr != "" && !"".equals(pageStr)) {
			page = Integer.valueOf(pageStr);
		}
		return page;
	}

	public static int getPageSize(HttpServletRequest request) {
		int pageSize = 20;
		String pageSizeStr = request.getParameter("rows");
		if (pageSizeStr != "" && !"".equals(pageSizeStr)) {
			pageSize = Integer.valueOf(pageSizeStr);
		}
		return pageSize;
	}
}
